<!--suppress ALL -->
<include file="./Template/header.html" />
<link rel="stylesheet" type="text/css" href="/Template/css/clubfootDay.css?v=2021052501">
<script type="text/javascript">

    $(function() {

        //初始化页面配置

        initPage("{$year}年度世界马蹄足日活动");

        var app = new Vue({
            el: '#container',
            data: {
                info: [],
            },
            methods: {

                index: indexPage,
                cancel: function() {
                    window.location.href = "/wechat/clubfoot/checkin";
                },
                save: function() {
                    var clubfootDayId = $("input[name=clubfootDayId]").val();
//                    var customerId = $("input[name=customerId]").val();
                    var telephone = $("input[name=telephone]").val();
                    var note = $("textarea[name=note]").val();


//                    if(isNullOrEmpty(telephone)) {
//                        alert("请填写电话号码");
//                        return false;
//                    }
//                    if(!checkPhone(telephone)) {
//                        alert("联系电话位数不对");
//                        return false;
//                    }
                    var doublePoint = "{$customerInfo.point}" * 2;
                    if(confirm("确认提交后，您的现有I币积分将清零，同时获得双倍积分【" + doublePoint + "】的代金券，是否继续提交？")) {
                        $(".save-btn").hide();
                        $.ajax({
                            url: "/wechat/clubfoot/updateClubfootDay",
                            type: "post",
                            data: {
                                clubfootDayId: clubfootDayId,
//                            customerId: customerId,
                                telephone: telephone,
                                note: note,
                            },

                            dataType: "JSON",
                            beforeSend: function () {
                                $("#loadingToast").show();
                            },
                            complete: function () {
                                $('#loadingToast').hide();
                            },
                            success: function (data) {
                                if (data.code == 200) {
                                    alert("申请成功");
                                    window.location.href = "/wechat/clubfoot/clubfootDay";
                                }
                            },
                        })
                    }
                }

            }
        })


        $("input[type=date]").change(function() {
            var value = $(this).val();
            $(this).prev().val(value);
        });

    });


</script>
<div class = "search">
    <div class="class-search">
        <span class="class-select">当前持有</span>
        <img class="lefthint" src="/Template/images/icon-icoin.png" alt="">
        <span class="class-select">币：</span>
        <span style="color: #fdd52a">{$customerInfo.point}</span>
    </div>
    <button class="info-button" v-on:click="cancel">马蹄足专区</button>
</div>
<!--<div style="display: none">-->
<div class="qiandao-bottom">
    <div class="qiandao-rule-list">
        <!--h4>
            2021年6月3日 0时- 24时 可点击下方 <a  style="font-weight: bold">[确认]</a> 按钮，您将会兑换<a style="font-weight: bold">2倍</a>I币积分优惠券，2021年12月31日前持此券购买Iowa支具(小黑鞋)时抵扣等值面额现金。
        </h4-->
        <php>
            $doublePoint = $customerInfo["point"] * 2;
        </php>
        <p>
            <a style="font-weight: bold;">{$year}年6月3日 0时-24时 </a>可点击下方 <a style="font-weight: bold; color: #4293df">[确认]</a> 按钮，您将会兑换 <a style="font-weight: bold; color: #fd8f3e">2倍</a> I币积分的代金券【<a style="font-weight: bold; color: #fd8f3e">{$doublePoint}</a>】，<a style="font-weight: bold;">{$year}年12月31日前</a>持此券购买Iowa支具(小黑鞋)时可抵扣等值面额现金。
        </p>
    </div>
</div>
<div class="edit-content">
    <input type="text" style="display: none;" name="clubfootDayId" value="{$info.clubfoot_day_id}">
    <!--<input type="text" style="display: none;" name="customerId" value="{$customerInfo.customer_id}">-->
    <!--div class="item">
        <span>购买人*</span>
        <input type="text" name="invoiceName" value="{$info.invoice_name}" placeholder="请填写发票上的购买方名称">
        <img class="icon-right" src="/Template/images/icon-right.png" alt="">
    </div>
    <div class="item">
        <span>联系电话</span>
        <input type="text" name="telephone" value="{$info.telephone}" placeholder="请填写您的电话号码">
        <img class="icon-right" src="/Template/images/icon-right.png" alt="">
    </div>
    <div class="title-span">
        <span>留言</span>
    </div>
    <div class="area">
        <textarea class="t-area" name="note" placeholder="请填写您的留言（非必填）">{$info.note}</textarea>
    </div-->
</div>
<if condition="$info['status'] gt -2">
    <div class="subscribe">
        <p class="notify">
            您已获得优惠券 <a style="font-weight: bold;color: #fdd52a">{$info.point}</a>
            <br>
            请添加下方管理员索取优惠券
        </p>
        <div class="pop-frame">
            <div class="hint">
                <div class="line"></div>
                <p class="rec-title">无法识别二维码?</p>
                <ul>
                    <li>1、打开微信,点击添加朋友</li>
                    <li>2、搜索微信号：<a style="font-weight: bold; color: #5bd990">xiweikang</a></li>
                    <li>3、点击”关注”,完成</li>
                </ul>
            </div>
        </div>
        <div class="two-d-code">
            <img class="two-d-code-bg" src="/Template/images/doc-2d-code-bg.png" alt="">
            <img class="two-d-code-img" src="/Template/images/customer-service-qrcode.png" alt="">
            <p class="recognize">
                长按图片 <a style="font-weight: bold">[识别二维码]</a> 添加管理员
                <br>
                <a style="font-weight: bold;color: #27e6fd">{$nowTime}</a>
                <br>
                <a style="font-weight: bold;color: #27e6fd">{$customerInfo.nickname}</a>
            </p>
        </div>
    </div>
</if>

<if condition="$info['status'] eq null && $rightDay eq 'TRUE' && $customerInfo['point'] gt 0">
    <div class="operation-btn" style="text-align: center">
            <div class="confirm-btn" v-on:click="save">确认</div>
    </div>
</if>

<if condition="$info['status'] eq null && $rightDay eq 'TRUE' && $customerInfo['point'] eq 0">
    <div class="operation-btn" style="text-align: center">
        <a style="color: #fd8f3e;font-weight: bold">积分不足</a>
    </div>
</if>

<if condition="$info['status'] eq null && $rightDay eq 'FALSE'">
    <div class="operation-btn" style="text-align: center">
        <a style="color: #fd8f3e;font-weight: bold">活动仅在 {$year}年6月3日 开放</a>
    </div>
</if>

<include file="./Template/footer.html" />

